import { Button, } from "antd";
import { useContext } from 'react'
import { ColorContext, UpColor, } from './Color'

function Buttons() {
  const { dispatch } = useContext(ColorContext)
  return (
    <div>
      <Button onClick={() => dispatch({ type: UpColor, color: "red" })}>红色</Button>
      <Button onClick={() => dispatch({ type: UpColor, color: "yellow" })}>黄色</Button>
    </div>
  )
}

export default Buttons